package com.fucius.study.leetcode;

import java.util.Arrays;

public class NumberOfWeeks {

    public long numberOfWeeks(int[] a) {
        int count = 0;
        Arrays.sort(a);
        int i=0,j=a.length-1;
        while(i<j){
            if(a[i]<a[j]){
                count += (a[i]<<1);
                a[j]=a[j]-a[i++];
                continue;
            }
            if(a[i]==a[j]){
                count += (a[i]<<1);
                i++;
                j--;
                continue;
            }


        }
        return 0;
    }

    public static void main(String[] args) {
        System.out.println(-100&1);
        System.out.println(100&1);
    }
}
